require("../scss/admin_home.scss")
require("../scss/admin_students.scss")

import {Provider} from "react-redux"
import {AdminStudentsCtrlContainer} from "./containers/admin/AdminStudentsCtrlContainer.jsx"
import AdminHeader from "./components/admin/AdminHeader/AdminHeader.jsx"
import AdminSidebar from "./components/admin/AdminSidebar/AdminSidebar.jsx"

const createStoreWithMiddleware = require("./common/common").createStoreWithMiddleware
import adminCourseCtrlApp from "./reducers/admin/admin_students_reducers.js"

let store = createStoreWithMiddleware(adminCourseCtrlApp)       // store和reducers绑定在一起（数据和数据处理绑定在一起）

// todo: 这里应该是用模板套上去而不是用React
ReactDOM.render(
    <AdminHeader />,
    document.getElementById("AdminHeader")
)

ReactDOM.render(
    <AdminSidebar />,
    document.getElementById("AdminSidebar")
)

ReactDOM.render(
    <Provider store={store}>
        <AdminStudentsCtrlContainer />
    </Provider>,
    document.getElementById("AdminStudentsCtrl")
)